package com.hd.tiyu.yuejian.Activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.VideoView;

import com.hd.tiyu.yuejian.R;

/**
 * Created by admin on 2017/10/31.
 */

public class KeVideoActivity extends AppCompatActivity {
    private VideoView videoView;
    private Button button;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_kevideo);
        videoView= (VideoView) findViewById(R.id.ke_videoView);
        button=(Button)findViewById(R.id.adsfadf);
        initData();

    }

    private void initData() {
        Intent intent=getIntent();
        String url=intent.getStringExtra("url");
        String name=intent.getStringExtra("videoname");
        videoView.setVideoPath("http://172.24.10.175/workout/Uploads/tvideo/video/"+url);
        if(!videoView.isPlaying()){
            videoView.start();
        }
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                videoView.pause();
            }
        });
    }
}
